#this is just a basic CMakeLists.txt, for more information see the cmake manpage

#add definitions, compiler switches, etc.
ADD_DEFINITIONS(-Wall -O0 -g)

INCLUDE_DIRECTORIES(${AVCODEC_INCLUDE_DIRS}	)
INCLUDE_DIRECTORIES(${AVFORMAT_INCLUDE_DIRS}	)
INCLUDE_DIRECTORIES(${AVUTIL_INCLUDE_DIRS}	)
INCLUDE_DIRECTORIES(${ALSA_INCLUDE_DIRS}	)
INCLUDE_DIRECTORIES(${X11_INCLUDE_DIRS}		)
INCLUDE_DIRECTORIES(${XV_INCLUDE_DIRS}		)
INCLUDE_DIRECTORIES(${DIRECTFB_INCLUDE_DIRS}	)
INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIRS}		)
INCLUDE_DIRECTORIES(${GTKGL_INCLUDE_DIRS}	)

ADD_DEFINITIONS(
	${DIRECTFB_CFLAGS_OTHER}
	${GTK_CFLAGS_OTHER}
	${GTKGL_CFLAGS_OTHER}
)

#build a shared library
ADD_LIBRARY(mediaplayer SHARED
	common/array.c
	common/ll.c
	renderers/audio/alsa.c
	renderers/video/xv.c
	renderers/video/directfb.c
	renderers/video/gtk.c
	streams.c
	thread.c
	time.c
	events.c
	mediaplayer.c
)

TARGET_LINK_LIBRARIES(mediaplayer
	${AVFORMAT_LDFLAGS}
	${AVCODEC_LDFLAGS}
	${AVUTIL_LDFLAGS}
	${ALSA_LDFLAGS}
	${X11_LDFLAGS}
	${XV_LDFLAGS}
	${DIRECTFB_LDFLAGS}
	${GTK_LDFLAGS}
	${GTKGL_LDFLAGS}
)

IF(ENABLE_SAMPLE_APP)
	#for testing the shared library you probably need some test app too
	ADD_EXECUTABLE(libmediaplayertest libmediaplayertest.c)
ENDIF(ENABLE_SAMPLE_APP)

#need to link to some other libraries ? just add them here
TARGET_LINK_LIBRARIES(libmediaplayertest mediaplayer)

#add an install target here
#INSTALL_FILES(...)
#INSTALL_PROGRAMS(...)
#INSTALL_TARGET(...)

